package app.server.project.main.service.dto;

import app.server.project.main.service.db.entity.user.UserEnergyEntity;
import app.server.project.main.service.db.entity.user.UserInfoEntity;
import cn.hutool.core.bean.BeanUtil;
import lombok.Data;

@Data
public class EnergyDto {
    /**
     * 体力值上限
     */
    private long maxNum;
    /**
     * 体力值
     */
    private long energy;
    /**
     * 体力值更新时间 秒
     */
    private long time;
    /**
     * 体力值速度
     */
    private long speed;

    /**
     * 溢出体力值
     */
    private long rewardNum;

    public static EnergyDto of(UserEnergyEntity userEnergyEntity, UserInfoEntity userInfoEntity, long time, long speed) {
        EnergyDto dto = new EnergyDto();
        BeanUtil.copyProperties(userEnergyEntity, dto, true);
        BeanUtil.copyProperties(userInfoEntity, dto, true);
        dto.time = time;
        dto.speed = speed;
        return dto;
    }

}
